package com.etong.frame.directive.mybatis;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.etong.frame.directive.GroupConfig;
import com.etong.frame.directive.mybatis.DirectiveStatement;

public interface DirectiveStatementMapper {
	int deleteByPrimaryKey(Integer id);

	int insert(DirectiveStatement record);

	int insertSelective(DirectiveStatement record);

	DirectiveStatement selectByPrimaryKey(Integer id);

	int updateByPrimaryKeySelective(DirectiveStatement record);

	int updateByPrimaryKey(DirectiveStatement record);

	@Select("${statement}")
	List<Map<String, Object>> execSelectList(
			@Param("statement") String statement);

	@Select("${statement}")
	Map<String, Object> execSelectOne(@Param("statement") String statement);

	@Select("${statement}")
	int execSelectInt(@Param("statement") String statement);

	@Insert("${statement}")
	int execInsert(@Param("statement") String statement);

	@Insert("${statement}")
	int execDelete(@Param("statement") String statement);

	@Update("${statement}")
	int execUpdate(@Param("statement") String statement);

	@Select("Select * from t_sql_directive where deleted=0")
	List<Map<String, Object>> getDirectiveConfigs();

	@Select("Select * from t_sql_group where deleted=0")
	List<GroupConfig> getGroupConfigs();

	@Select("Select count(*) from t_sql_directive where name=#{name}")
	int checkDirectiveConfig(@Param("name") String name);

	@Select("Select * from t_sql_checker where deleted=0")
	List<Map<String, Object>> getCheckerConfigs();
}